﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability_Management.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class 读取33 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Company",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Content",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Path",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Time",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Processing_Batch1",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Processing_Batch2",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Processing_Batch3",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Processing_Batch4",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Processing_Company",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Processing_ProductionLicense",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Farming_People",
                table: "Farmings");

            migrationBuilder.DropColumn(
                name: "Farming_Please",
                table: "Farmings");

            migrationBuilder.DropColumn(
                name: "Farming_SaveCout",
                table: "Farmings");

            migrationBuilder.CreateTable(
                name: "Farmings_Next",
                columns: table => new
                {
                    Farmings_Next_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Farming_Please = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Farming_People = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Farming_SaveCout = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Farmings_Next", x => x.Farmings_Next_Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Processiings_Four",
                columns: table => new
                {
                    Shenchan_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_ShencanCode = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processiings_Four", x => x.Shenchan_Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Processiings_Next",
                columns: table => new
                {
                    Processiings_NextId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_Company = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_ProductionLicense = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processiings_Next", x => x.Processiings_NextId);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Processiings_One",
                columns: table => new
                {
                    Shenchan_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_ShencanCode = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processiings_One", x => x.Shenchan_Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Processiings_Three",
                columns: table => new
                {
                    Shenchan_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_ShencanCode = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processiings_Three", x => x.Shenchan_Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Processiings_Two",
                columns: table => new
                {
                    Shenchan_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Processing_ShencanCode = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processiings_Two", x => x.Shenchan_Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Slaughts_Next",
                columns: table => new
                {
                    Slaughts_NextId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Rabit_Batch = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Company = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Company_Time = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    Company_Path = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Company_Content = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughts_Next", x => x.Slaughts_NextId);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Farmings_Next");

            migrationBuilder.DropTable(
                name: "Processiings_Four");

            migrationBuilder.DropTable(
                name: "Processiings_Next");

            migrationBuilder.DropTable(
                name: "Processiings_One");

            migrationBuilder.DropTable(
                name: "Processiings_Three");

            migrationBuilder.DropTable(
                name: "Processiings_Two");

            migrationBuilder.DropTable(
                name: "Slaughts_Next");

            migrationBuilder.AddColumn<string>(
                name: "Company",
                table: "Slaughts",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Company_Content",
                table: "Slaughts",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Company_Path",
                table: "Slaughts",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<DateTime>(
                name: "Company_Time",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Processing_Batch1",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Processing_Batch2",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Processing_Batch3",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Processing_Batch4",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Processing_Company",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Processing_ProductionLicense",
                table: "Processiings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Farming_People",
                table: "Farmings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Farming_Please",
                table: "Farmings",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "Farming_SaveCout",
                table: "Farmings",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
